<?php
       	 
        $xcrud = Xcrud::get_instance();
        $xcrud->table('transfer_history');
		if(isset($_POST['day_begin']) && $_POST['day_begin']!=''){
			
			$daybg=$_POST['day_begin'];
			$dayend=$_POST['day_end'];
		$date = new DateTime($daybg);
		$daybg =$date->format('Y-m-d H:i:s');
		
		$date = new DateTime($dayend);
		$dayed= $date->format('Y-m-d H:i:s');

			
		$xcrud->where("", "transfer_history.date >= '{$daybg}' AND transfer_history.date <= '{$dayed}'");
		
		  $xcrud->table_name("Tranfer Scash Manage <small> From ".$_POST['day_begin']." To ".$_POST['day_end']."</small>");
		}else{
		 $xcrud->table_name("Tranfer Scash Manage ");
		}
          $xcrud->relation('user_id','user','id','username');
        $xcrud->relation('game_id', 'game_category', 'id', 'tieude');
        
    
   
                 $xcrud->theme('bootstrap');
             
                $xcrud->unset_add();
				$xcrud->show_primary_ai_column(true);
				?>
                 <fieldset>
    <legend>Filter </legend>
            <form class="form-inline" method="post" action="">
  <input type="date" name="day_begin">
  <input type="date" name="day_end">
 
 
  <button type="submit" class="btn">View</button>
</form> 
</fieldset>
                <?php
                echo $xcrud->render();
            
              
?>

